package pro.lepers.portfolio.view.header {
	import fr.digitas.flowearth.conf.Conf;
	import fr.digitas.flowearth.ui.layout.Layout;
	import fr.digitas.flowearth.ui.layout.renderer.TopRenderer;

	import flash.display.Sprite;
	import flash.geom.Rectangle;

	/**
	 * @author plepers
	 */
	public class Nav extends Sprite {
		private var _layout : Layout;

		
		public function Nav () {
			_buildLayout( );
			_buildItems( );
		}

		private function _buildItems () : void {
			
			var navData : XML = Conf.getDatas( "nav" );
			
			var item : NavItem;
			for each (var idata : XML in navData.item ) {
				item = new NavItem_FC();
				item.setDatas( idata );
				_layout.addChild( item );
			}
		}

		private function _buildLayout () : void {
			
			_layout = new Layout( );
			_layout.renderer = new TopRenderer( );
			_layout.margin = new Rectangle( 0, 0, 0, 4);
			
			addChild( _layout );
		}
	}
}
